24#define mrb_class_ptr(v) ((struct RClass*)(mrb_ptr(v)))
29 if (!mrb_immediate_p(v)) {
30 return mrb_obj_ptr(v)->c;
33 switch (mrb_type(v)) {
36 return mrb->false_class;
37 return mrb->nil_class;
39 return mrb->true_class;
41 return mrb->symbol_class;
43 return mrb->integer_class;
46 return mrb->float_class;
49 return mrb->object_class;
64#define MRB_FL_CLASS_IS_PREPENDED (1 << 19)
65#define MRB_FL_CLASS_IS_ORIGIN (1 << 18)
66#define MRB_CLASS_ORIGIN(c) do {\
67 if ((c)->flags & MRB_FL_CLASS_IS_PREPENDED) {\
69 while (!((c)->flags & MRB_FL_CLASS_IS_ORIGIN)) {\
74#define MRB_FL_CLASS_IS_INHERITED (1 << 17)
75#define MRB_INSTANCE_TT_MASK (0x1F)
76#define MRB_SET_INSTANCE_TT(c, tt) ((c)->flags = (((c)->flags & ~MRB_INSTANCE_TT_MASK) | (char)(tt)))
77#define MRB_INSTANCE_TT(c) (enum mrb_vtype)((c)->flags & MRB_INSTANCE_TT_MASK)
78#define MRB_FL_UNDEF_ALLOCATE (1 << 6)
79#define MRB_UNDEF_ALLOCATOR(c) (mrb_assert((c)->tt == MRB_TT_CLASS), (c)->flags |= MRB_FL_UNDEF_ALLOCATE)
80#define MRB_UNDEF_ALLOCATOR_P(c) ((c)->flags & MRB_FL_UNDEF_ALLOCATE)
81#define MRB_DEFINE_ALLOCATOR(c) ((c)->flags &= ~MRB_FL_UNDEF_ALLOCATE)
93#ifndef MRB_NO_METHOD_CACHE
96#define mrb_mc_clear_by_class(mrb,c)
109 const struct RProc *proc;
126#define MRB_MT_READONLY_BIT (1 << 30)
127#define MRB_MT_FROZEN_BIT (1 << 29)
128#define MRB_MT_FUNC (1 << 24)
129#define MRB_MT_PUBLIC 0
130#define MRB_MT_PRIVATE (1 << 25)
133#define MRB_MT_ENTRY(fn, sym, flags) \
134 { { (fn) }, (sym), (flags) | MRB_MT_FUNC }
135#define MRB_MT_ASPEC(flags) ((mrb_aspec)((flags) & 0xffffff))
142#define MRB_MT_REMOVED_P(e) (((e).flags&MRB_MT_FUNC) && (e).val.func==NULL)
154#define MRB_MT_INIT_ROM(mrb, cls, entries) \
155 mrb_mt_init_rom(mrb, cls, entries, \
156 (int)(sizeof(entries)/sizeof(entries[0])))
mruby common platform definition"
#define MRB_INLINE
Declare a function as always inlined.
Definition common.h:97
#define MRB_END_DECL
End declarations in C mode.
Definition common.h:28
#define MRB_BEGIN_DECL
Start declarations in C mode.
Definition common.h:26
#define MRB_API
Declare a public mruby API function.
Definition common.h:108
mrb_value(* mrb_func_t)(mrb_state *mrb, mrb_value self)
Function pointer type for a function callable by mruby.
Definition mruby.h:227
Class class.
Definition class.h:17
Definition boxing_nan.h:40